Skip to content

Conversation

@Pixel998
Copy link
Contributor

@Pixel998 Pixel998 commented Jan 7, 2026

Prerequisites checklist

What is the purpose of this pull request?

This PR configures knip to properly recognize public API types in src/types.ts files so they aren't incorrectly flagged as unused exports. These types are meant for external consumption by package users, even if they're not used internally within our codebase.

What changes did you make? (Give an overview)

Added src/types.ts to the knip entry configuration for four packages that export public types:

  • @eslint/config-array
  • @eslint/config-helpers
  • @eslint/migrate-config
  • @eslint/plugin-kit

The @eslint/object-schema package already had this configuration.

Related Issues

#351

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jan 7, 2026
@fasttime fasttime moved this from Needs Triage to Triaging in Triage Jan 10, 2026
@fasttime
Copy link
Member

I believe knip is already recognizing src/types.ts files; otherwise it would flag them as unused. The issue in #351 seems to be an unreferenced type definition. I’ve added a comment on the PR with a possible fix.

@Pixel998
Copy link
Contributor Author

@fasttime
Copy link
Member

Sorry, I meant this knip issue: https://github.com/eslint/rewrite/actions/runs/20762026304/job/59619177443

That's the same error. It will no longer appear now that CustomRuleVisitorWithExit is being reexported.

@Pixel998 Pixel998 changed the title chore: add src/types.ts to knip entry configuration chore: remove src/types.ts from knip entry configuration Jan 13, 2026
@Pixel998
Copy link
Contributor Author

You're right. My point was that knip needs explicit re-exports to avoid flagging types. I originally opened this PR thinking we'd need a structural fix (like /types exports or the eslint/markdown dummy file approach) that would require telling knip about src/types.ts.

Since we've gone with the re-export approach instead, these configuration entries are no longer needed. I've updated the PR to remove all of them.

@fasttime fasttime moved this from Triaging to Implementing in Triage Jan 14, 2026
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fasttime fasttime merged commit 622beb9 into main Jan 14, 2026
32 checks passed
@fasttime fasttime deleted the chore/knip-types-entry branch January 14, 2026 09:45
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants